package cn.com.dhcc.ddi.task.service.extract.impl;

import cn.com.dhcc.app.core.exception.ServiceException;
import cn.com.dhcc.app.core.service.Log;
import cn.com.dhcc.app.pub.core.consts.AppIocBean;
import cn.com.dhcc.ddi.task.service.DataSet;
import cn.com.dhcc.ddi.task.service.Result;
import cn.com.dhcc.ddi.task.service.extract.EDataSourceDBAbstract;
import cn.com.dhcc.ddi.task.service.transform.MapOrder;
import cn.com.dhcc.ddi.task.vo.Task;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import java.util.Set;

/**
 * 数据抽取的Mysql实现
 *
 * @Date：2016/11/17 11:51
 * @author：张洪涛
 * @版权所有：东华软件
 * @版本：1.0
 */
@Service(AppIocBean.E_DATASOURCE_MYSQL_IMPL)
public class EDataSourceMysqlImpl extends EDataSourceDBAbstract {
    private static Logger logger = Log.getLogger(Log.LOGTYPE.DDI);

    @Override
    public Result extractData(Task task, String taskLogId) throws ServiceException {
        String sql = "select date_format(NOW(), '%Y-%m-%d %H:%i:%s') from dual";
        return super.extract(task, taskLogId, sql);
    }

    @Override
    public DataSet extractData(String dataSourceMeteData,
                               Set<MapOrder> mapOrders) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public Result loadData(String dataSourceMeteData, DataSet dataSets) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public void reciveNotify(String taskLogId, String status, String msg) {
        super.reciveNotify(taskLogId, status, msg);
    }

}
